Focus adjusting apparatus and focus adjusting method

ABSTRACT

There are provided a focus adjusting apparatus and method in which a look of an image plane can be improved when an object area to be focused in the image plane is judged and focused prior to image-taking preparation operation. A first operation for determining the object area to be focused is performed prior to the image-taking preparation operation, and a second operation for performing the focus adjusting operation is performed at the time of the image-taking preparation operation.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to focus adjusting apparatuses and focusadjusting methods. Particularly, the present invention relates toautomatic focus adjusting techniques.

2. Description of the Related Art

Conventionally, in a case where automatic focusing (AF) is performed inelectronic still cameras and video cameras, a method is used, in which alens position at which a high frequency component of a luminance signalsupplied from an image-pickup element, such as CCD (Charge CoupledDevice), is maximum is treated as an in-focus position. The followingscan method is known as such a method. In the scan method, an evaluationvalue (focus evaluation value) calculated based on the high frequencycomponent of the luminance signal obtained from the image-pickup elementis successively stored while the lens is driven over its entire moverange, and the lens position at which the thus-stored evaluation valueexhibits the maximum is treated as the in-focus position.

In another method, a lens continues to be moved in such a direction thatthe focus evaluation value increases. This method is known as the hillclimbing method (also referred to as continuous AF hereinafter).

Further, Japanese Patent No. 4,106,485 discloses the following method.In this method, the continuous AF is executed prior to instructions forimage-taking preparation operation to maintain an in-focus state,thereby restricting the move range of a focus lens to be moved by the AFscan method for performing the image-taking preparation operationsubsequent to instructions therefor. Thus, the AF operation time isdecreased.

In the continuous AF, in a case where the lens is to be moved in such adirection that the focus evaluation value increases, focusing cannot beexecuted on an object to be focused unless an area to be focused isidentified in an image plane.

In the method of the above Japanese Patent, the above scan method iscombined with the continuous AF to speedily perform the focusingoperation. However, identification is not performed with respect to anobject (principal object) to be focused in the image plane, on which auser wants to focus. Therefore, there is a possibility that focusingcannot be executed on an object to be focused, depending on thecondition of a photo-taking scene.

SUMMARY OF THE INVENTION

According to the present invention, an apparatus includes a receivingunit configured to receive an instruction for focus adjustment, animage-pickup unit configured to perform image-pickup of an image inputthrough a focus lens to supply image data, a setting unit configured toset a focus detecting area, and a focus adjusting unit configured todetect a focus signal in the focus detecting area while moving the focuslens to adjust the position of the focus lens in a predetermined rangebased on the focus signal, and in which the focus adjusting unitcontrols a first operation for detecting the focus signal prior toreception of the instruction to determine an object area to be focused,and a second operation for detecting the focus signal based oninformation of the determined object area upon reception of theinstruction to perform the focus adjustment of the focus lens, and stopsthe focus lens at a predetermined position based on at least one of anevaluation value relevant to luminance of the image data in apredetermined area and the focus signal. The focus signal represents afocus state of the focus lens.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating the structure of an embodiment ofa focus adjusting apparatus according to the present invention.

FIG. 2 is a flow chart showing the focus adjusting operation of theembodiment.

FIG. 3 is a flow chart showing a subroutine of focus judgment in FIGS. 7and 10.

FIG. 4 is a view illustrating a manner of the focus judgment in FIG. 3.

FIG. 5 is a flow chart showing a subroutine of object area identifyingor determining AF scan in FIG. 2.

FIG. 6 is a view illustrating an example of AF frame setting in FIG. 5.

FIG. 7 is a flow chart showing a subroutine of principal object areajudgment in FIGS. 8 and 9 of first and second embodiments.

FIGS. 8A to 8C are views illustrating the principal object area judgmentin FIG. 7.

FIG. 9 is a flow chart showing a subroutine of zone AF scan in FIG. 5.

FIG. 10 is a flow chart showing a subroutine of zone renewal judgment inFIG. 9 of first and second embodiments.

FIGS. 11A and 11B are views illustrating an example of the zone renewaljudgment in FIG. 10.

FIG. 12 is a flow chart showing a subroutine of uniformity judgingoperation in FIG. 5 of the first embodiment.

FIG. 13 is a flow chart showing a subroutine of the uniformity judgmentin FIG. 12 of the embodiment.

FIGS. 14A and 14B are views illustrating a manner of the uniformityjudgment in FIG. 12.

FIG. 15 is a flow chart showing a subroutine of focusing drive in FIG. 5of the embodiment.

FIG. 16 is a flow chart showing a subroutine of continuous AF in FIG. 2of the embodiment.

FIG. 17 is a flow chart showing a subroutine of image-taking process inFIG. 2 of the embodiment.

FIG. 18 is a flow chart showing a subroutine of AF operation for finalexposure in FIG. 17 of the first embodiment.

FIG. 19 is a flow chart showing a subroutine of uniformity judgingoperation in FIG. 5 of the second embodiment.

FIG. 20 is a flow chart showing a subroutine of uniformity judgingoperation in FIG. 5 of a third embodiment.

FIGS. 21A to 21C are views illustrating a manner of re-setting of the AFframe area in FIG. 20.

FIG. 22 is a flow chart showing a subroutine of the zone renewaljudgment in FIG. 9 of the third embodiment.

FIG. 23 is a flow chart showing a subroutine of the principal objectarea judgment in FIGS. 8 and 9 of the third embodiment.

FIG. 24 is a flow chart showing a subroutine of AF operation for finalexposure in FIG. 18 of the third embodiment.

DESCRIPTION OF THE EMBODIMENTS

Various embodiments of the present invention will be described in detailin accordance with the accompanying drawings.

FIG. 1 illustrates the structure of a camera with the embodiment of afocus adjusting apparatus according to the present invention.

In FIG. 1, reference numeral 101 designates an image-taking lensincluding a zoom mechanism. Reference numeral 102 designates adiaphragm/shutter for controlling the amount of incident light.Reference numeral 103 designates an AE processing portion including adrive portion for driving the diaphragm/shutter. Reference numeral 104designates a focus lens for performing focusing on an image-pickupelement described below. Reference numeral 105 designates an AFprocessing portion including a drive portion for the focus lens 104.Reference numeral 106 designates an electric flash unit. Referencenumeral 107 designates an electric flash (EF) processing portion.

Reference numeral 108 designates the image-pickup element or imager forconverting reflection light from an object into an electric signal.Reference numeral 109 designates an A/D converting portion including aCDS (correlated double sampling) circuit for removing noises in anoutput from the image-pickup element 108 and a non-linear amplifyingcircuit for performing process prior to the A(analog)/D(digital)conversion.

Reference numeral 110 designates an image processing portion forperforming process of calculating a luminance signal of the object fromthe output signal of the image-pickup element, and extracting a signalcomponent in a specific frequency band of the luminance signal toacquire the focus evaluation value, and other processes. Referencenumeral 111 designates a WB (white balance) processing portion.Reference numeral 112 designates a format converting portion.

Reference numeral 113 designates a high-speed built-in memory (alsoreferred to as DRAM) such as a random access memory. The DRAM 113 can beused as a high-speed buffer memory for temporarily storing image data,or a work memory for image compression and decompression. Referencenumeral 114 designates an image recording portion including a recordingmedium such as a memory card, and its interface. Reference numeral 115designates a system controlling portion (CPU) for controlling the entiresystem in operations such as image-taking sequence. Reference numeral116 designates a memory for image display (VRAM).

Reference numeral 117 designates an operation displaying portion fordisplaying not only images but also indications for assistingoperations, indications showing the camera status, and indicationsshowing the image-taking screen or image plane, and focus detectingareas at the time of image-taking. Reference numeral 118 designates anoperating portion for operating the camera from outside. The operatingportion 118 includes a menu switch for various settings such as asetting of image-taking function and a setting of image replaying, azoom lever for instructing the zoom operation of the image-taking lens,and an operation mode changing switch for changing the operation modebetween an image-taking mode and a replaying mode, for example.Reference numeral 119 designates an image-taking mode switch forperforming a setting of ON or OFF of the face detection mode, and thelike.

Reference numeral 120 designates a main switch for turning on theelectric power of the system. Reference numeral 121 designates animage-taking stand-by switch (SW1) for performing instructions forimage-taking stand-by operations such as AF operation and AE operation.Upon operation of this SW1 (121), an in-focus position of the focus lens104 for image-taking is determined. Procedures for this determinationwill be described below. Reference numeral 122 designates animage-taking switch (SW2) for performing instructions for image-takingsubsequent to the operation of SW1.

Reference numeral 123 designates a face detection module for performingthe face detection by using the image signal processed by the imageprocessing portion 110, and supplying information (position, size andreliability) of a face or plural faces detected to the CPU 115.Reference numeral 124 designates a moving object detecting portion fordetecting whether or not the object or background in the image plane ismoving, and supplying the moving object information to the CPU 115. Morespecifically, two images arranged in time series of image signalsprocessed by the image processing portion 110 are compared with eachother, and from difference information of the comparison result, themoving object information (move amount, position and range) of theobject/background is detected.

Reference numeral 125 designates an angular velocity sensor fordetecting the angular velocity of the camera, and supplying informationof the camera motion to the CPU 115. By using the angular velocitysensor, it is also possible to detect the attitude of the camera (i.e,erected attitude or horizontal attitude).

The operation of the electronic camera of this embodiment will bedescribed with reference to the flow chart in FIG. 2. In step S201, theCPU 115 judges the state (ON/OFF) of SW1 for performing instructions forimage-taking preparation. When the state is ON, the step proceeds tostep S212. When the state is OFF, the state proceeds to step S202. Instep S202, scene stability is judged. In step S203, the judgment ofstability of the image-taking scene in step S202 is checked. When theimage-taking scene is judged to be stable, the step proceeds to stepS204. If not, the step returns to step S201. Here, the stable state ofthe image-taking scene is a state in which the object to be photographedand the camera are maintained stable so that the image-taking can beappropriately performed. For example, when the move amount of the cameradetected by the angular velocity sensor 125 is below a given amount, thestate of the camera can be considered to be stable.

In step S204, whether or not the object luminance is below a given valueis checked. When the object luminance is below a given value, the stepproceeds to step S205. If not, the step proceeds to step S206. In stepS205, an AF frame setting for low luminance is performed. Here, the AFframe is an area in the image plane at which the focus evaluation valueis obtained. Further, the focus evaluation value is a value that isacquired by converting the analog picture image signal read from theimage-pickup element 108 into the digital signal by the A/D convertingportion 109, and extracting the high frequency signal component of theluminance signal from the digital signal by the image processing portion110. This evaluation value is stored in the CPU 115, corresponding topositions of the focus lens 104 and the AF frame. To obtain the focusevaluation value means to read the focus evaluation value stored in theCPU 115 for the purpose of judgment in the AF control by the AFprocessing portion 105. When the luminance is low, the exposure time islikely to lengthen. Hence, a sufficient AF precision can be hardlysecured in the AF scan. Accordingly, in this embodiment, when theluminance is low, the identification or determination of the object areaand the scan for the face detection are omitted, and a single AF framewith a given size is set near a central portion of the image plane.

In step S206, the face detection module 123 checks whether the face isdetected or not. When the face is detected, the step proceeds to stepS207. If not, the step proceeds to step S208. In step S207, the AF scanat the time of the face detection is performed. Then, the step proceedsto step S209. In step S208, the AF scan for determining the object areais performed according to procedures described below (see FIG. 5). Instep S209, the continuous AF is performed according to proceduresdescribed below (see FIG. 16).

Here, alternatively, it is possible to perform the focusing operationabout the determined object area only once without performing thecontinuous AF, or only determine the object area. In such a case, thestep succeeds to a next second scan operation.

In step S210, the scene instability judgment is performed. In step S211,whether or not the image-taking scene is judged to be instable in stepS210 is checked. When the scene is judged to be instable, the stepproceeds to step S201. If not, the step proceeds to step S209. Here, theinstable state of the image-taking scene is a state in which the stateof the object or the camera is so instable that an appropriateimage-taking cannot be achieved. For example, the move amount of thecamera detected by the angular velocity sensor 125 is above a givenamount, or the change amount of the luminance from the previous one isabove a given amount, or the face detection state (i.e, the face isdetected or not) detected by the face detection module 123 changes. Insuch a case, it is judged that the image-taking scene changes (i.e, thescene is instable).

At the time when the state of SW1 for instructing the image-takingpreparation is ON, the step proceeds from step S201 to step S212. Instep S212, the focus degree judging flag is set to FALSE. In step S213,the image-taking process is executed according to procedures describedbelow (see FIG. 17).

During the above-discussed operation, the AE processing portion 103controls the diaphragm/shutter 102 based on the control signal from theCPU 115. Brightness of the image displayed on the operation displayingportion 117 is made appropriate by such AE operation for controlling AEprocessing portion 103.

A subroutine of focus judgment in step S1201 in FIG. 7, and step S1501in FIG. 10 described below will be described with reference to FIGS. 3and 4.

Where the abscissa indicates the focus lens position and the ordinateindicates the focus evaluation value, the focus evaluation value changesin the form of a hill shape as illustrated in FIG. 4, except a casewhere competition of far and near objects exists, and the like.Accordingly, the focus judgment can be executed by judging the hillshape from a difference between maximum and minimum focus evaluationvalues, a length of a slope portion whose slope has an inclination abovea given value (Slope Thr), and a slope or inclination of the slopeportion.

The result in the focus judgment is supplied as the following o-judgmentand x-judgment.

o-judgment: Contrast of the object is sufficient, and the object existsin a distance range scanned.

x-judgment: Contrast of the object is insufficient, or the object existsoutside the distance range scanned.

Further, in the x-judgment, Δ-judgment is used in a case where theobject exists outside the scanned distance range on the wide-angle side.

The length L of the above slope portion and the slope SL/L of the slopeportion for judging the hill shape will be described with reference toFIG. 4. SL indicates a hill height of the slope portion. Points D and Eindicate points at which the slope can be deemed to continue from a hilltop (point A), and L is a hill width between the points D and E. A rangeover which the slope can be deemed to continue is a range over whichscan points with the focus evaluation value lower than that at the pointA by above a given amount (Slope Thr) are successively present. The scanpoint is a point at which the focus evaluation value is to be obtainedduring continuous move of the focus lens from the scan start point tothe scan finish point. The above SL is equal to SL1+SL2 where SL1 is thedifference between focus evaluation values at the points A and D and SL2is the difference between focus evaluation values at the points A and E.

In the flow chart of FIG. 3, maximum and minimum of the focus evaluationvalue are obtained in step S601. Then, in step S602, the scan point atwhich the focus evaluation value culminates is obtained, and the stepproceeds to step S603. In step S603, L and SL for judgment of the hillshape are obtained from scan points and focus evaluation values, and thestep proceeds to step S604.

In step S604, whether or not the hill shape has an upward-sloping end onthe wide-angle side is judged. For positive judgment of theupward-sloping end on the wide-angle side, the following two conditionsshould be satisfied. One condition is that the scan point at which thefocus evaluation value is maximum appears at the end on the wide-angleside in a given scan range. The other condition is that a differencebetween focus evaluation values at the scan point at the end on thewide-angle side and the scan point located one point away from the endtoward the telephoto side is above a given value. When positive judgmentof the upward-sloping end on the wide-angle side is made, the stepproceeds to step S609. If not, the step proceeds to step S605.

In step S605, whether or not the hill shape has an upward-sloping end onthe telephoto side is judged. For positive judgment of theupward-sloping end on the telephoto side, the following two conditionsshould be satisfied. One condition is that the scan point at which thefocus evaluation value is maximum appears at the end on the telephotoside in a given scan range. The other condition is that a differencebetween focus evaluation values at the scan point at the end on thetelephoto side and the scan point located one point away from the endtoward the wide-angle side is above a given value. When positivejudgment of the upward-sloping end on the telephoto side is made, thestep proceeds to step S608. If not, the step proceeds to step S606.

In step S606, in a case where the length L of the slope portion with theinclination above a given value is above a given value, the averagevalue SL/L of the inclination of the slope portion is above a givenvalue, and the difference between maximum (Max) and minimum (Min) focusevaluation values is above a given value, the step proceeds to stepS607. If not, the step proceeds to step S608. In step S607, the resultis judged to be the o-judgment, since focus evaluation values obtainedhave the hill shape, the object has the contrast, and the focusadjustment is possible. In step S608, the result is judged to be thex-judgment, since focus evaluation values obtained do not have the hillshape, the object does not have the contrast, and the focus adjustmentis impossible. In step S609, the result is judged to be the Δ-judgment,since the upward slope toward the wide-angle side exists although focusevaluation values obtained do not have the hill shape, and there is apossibility that the peak exists on the wide-angle side. The focusjudgment is thus performed.

FIG. 5 is the flow chart of the object area identifying or determiningAF scan in step S208 in FIG. 2. Herein, the AF scan for determining aprincipal object area on the image plane is performed.

In step S801, whether or not the electronic zoom is executed is checked.When the electronic zoom is performed, the step proceeds to step S802.If not, the step proceeds to step S803. In step S802, the AF framesetting for the electronic zoom is performed. Here, in the electroniczoom, a central area of the image plane is expanded, and the expandedarea is displayed on the operation displaying portion 117. At this time,since a narrow area on the image-pickup element 108 is expanded, theimage displayed on the operation displaying portion 117 is composed ofpixels whose number is smaller than that of an image at the time theelectronic zoom does not executed. Accordingly, if the AF frame settingis conducted so that the frame ratio in the image displayed on theoperation displaying portion 117 at the time of the electronic zoom isidentical with that at the time when the electronic zoom is notexecuted, the pixel number in the AF frame at the former time becomessmaller than that at the latter time. Hence, a signal-to-noise ratio ofthe focus evaluation value decreases at the time of the electronic zoom.Therefore, AF frame settings are made different between those times. Inthis embodiment, at the time of the electronic zoom, a single AF framehaving a give size is set near a central portion of the image plane.

In step S803, N*N AF frames are set on the image plane. For example,where N=5 and lengths of the AF frame in horizontal and verticaldirections are set to 10 percent of those of the image plane, AF framesare set as illustrated in FIG. 6. N or the AF frame size can be setconsidering a presence probability of the principal object in the imageplane. Further, numbers of AF frames in horizontal and verticaldirections can be made different from each other.

In step S804, the judgment of reference to previous operation isperformed. In the judgment of reference to previous operation, to whatdegree the present image-taking scene changes from the image-takingscene previously AF-scanned is judged. This judgment can be executed,for example, by whether or not the object area could be determined inthe previous AF scan operation, whether or not the present lens positionis closer to the wide-angle end than a given position is, whether or nota time difference between previous and present AF scan operations iswithin a given time, or whether or not the present attitude of thecamera is the same as the previous one.

In step S805, when the present image-taking scene is judged to be aboutthe same as the previous one based on the result of the judgment ofreference to previous operation in step S804, the step proceeds to stepS806. If not, the step proceeds to step S809. In step S806, the AF scanfor the judgment of reference to previous operation is performed. Instep S807, whether or not the principal object area could be identifiedin the AF scan for the judgment of reference to previous operation instep S806 is checked. When the principal object area could bedetermined, the step proceeds to step S808. If not, the step proceeds tostep S809.

In step S808, the peak detection flag is set to TRUE. In step S809, thezone AF scan is performed according to procedures described below (seeFIG. 9). In step S810, whether or not the principal object area could beidentified in the zone AF scan in step S809 is checked. When theprincipal object area could be identified, the step proceeds to stepS808. If not, the step proceeds to step S811. In step S811, theuniformity judgment is performed according to procedures described below(FIG. 12). In step S812, since the principal object area is notdetermined in the zone AF scan of step S809, the AF frame is set to apredetermined area beforehand set in the image plane. This predeterminedarea is an area in which the principal object is likely to exist.Herein, this area is set at a central area of the image plane, forexample. In step S813, the focusing drive is executed according toprocedures described below (see FIG. 15).

FIG. 7 is the flow chart of the principal object area judgment of stepS1411 in FIG. 9 described below. In the principal object area judgment,whether or not the principal object area in the image plane could bedetermined is judged. FIGS. 8A to 8C illustrate an example of theprincipal object area judgment in FIG. 7. In this example, the size ofthe AF frame is set to 10 percent of the image plane, N=5, the scanrange is set to a range from zero (0) to 500, and a given depth range isset to ±10. Here, numerals of the scan range and the given depth rangeare numerals for representing the position of the focus lens 104. Thesecorrespond to pulse numbers of a stepping motor (not shown) used as thedriving motor for the focus lens 104, and their values increase as thefocus lens 104 approaches the wide-angle end.

In step S1201, the above-described focus judgment in FIG. 3 is performedfor every AF frame set. For example, in every AF frame, the focusjudgment result is assumed to be one illustrated in FIG. 8A. In stepS1202, the peak position (PeakPos) of the focus evaluation value in eachAF frame is calculated and stored. For example, for every AF frame, thepeak position calculation result is assumed to be one illustrated inFIG. 8B. In step S1203, whether or not the number of AF frames is one(1) is checked. When a single AF frame is set, the step proceeds to stepS1214. If not, the step proceeds to step S1204.

In step S1204, PeakPos's of AF frames in central M*M frames are sortedfrom the wide-angle end. The number of sort is represented by S. In thefollowing description, it is assumed that M=3. Nine (3*3) framessurrounded by the thick solid line in FIGS. 8A to 8C exhibit the centralM*M frames. Here, the peak position of the AF frame with the x-judgmentjudged in the focus judgment of step S1201 cannot be calculated, so thatsuch an AF frame is excluded from AF frames to be sorted. For example,in the case of FIG. 8B, the sort result from the wide-angle end isindicated as 410, 400, 400, 400, 100, 100, 100 and 90, and the sortnumber S is S=8.

In step S1205, the count P for showing the order from the wide-angle endof peak positions in the M*M frames calculated in step S1202 is set toone (1). In step S1206, the P-th PeakPos in the sort order is set toPeakPosP. For example, in the case of FIG. 8B, when P=1, PeakPosP=410.In step S1207, in the central M*M AF frames, a lump of AF frames withthe o-judgment and within a given depth range from the frame of PeakPosPis detected, and the number and positions of AF frames constituting thelump are stored. Here, in the lump, AF frames satisfying the aboveconditions are adjoining each other in horizontal and verticaldirections, for example. In a case where there are plural lumps, one ofthem can be selected considering numbers of AF frames and positions ofthe respective lumps.

In step S1208, in central N*N AF frames, a lump of AF frames with theo-judgment and within a given depth range from the frame of PeakPosP isdetected so that at least one frame in the central M*M AF frames isinvolved in the above lump. And, the number and positions of AF framesconstituting this lump are stored. For example, in the case of judgmentresults as illustrated in FIGS. 8A and 8B, the lump including frames ingray illustrated in FIG. 8C is detected.

In step S1209, whether or not the lump detected in step S1207 or S1208includes a central frame is checked. When the lump includes the centralframe, the step proceeds to step S1215. If not, the step proceeds tostep S1210. In step S1210, whether or not the lump detected in stepS1207 or S1208 includes at least a given number of frames in the M*Mframes is checked. When the lump includes such frame or frames, the stepproceeds to step S1215. If not, the step proceeds to step S1211. In stepS1211, whether or not the lump detected in step S1207 or S1208 includesat least one frame of the central M*M frames and at least a given numberof frame or frames of the N*N frames is checked. When the lump includessuch frames, the step proceeds to step S1215. If not, the step proceedsto step S1212. In step S1212, one (1) is added to the count P. In stepS1213, whether or not the count P is larger than the sort number S ischecked. When the count P is larger than the sort number S, the stepproceeds to step S1217. If not, the step returns to step S1206.

In step S1214, whether or not the focus judgment result in step S1201 isthe o-judgment is checked. When the result is the o-judgment, the stepproceeds to step S1215. If not, the step proceeds to step S1217. In stepS1215, positive judgment of determination of the principal object areais made. In step S1216, AF frame or frames constituting the lump isjudged to be the principal object area and selected, and the currentjudgment process is finished. In a case where the thus-set AF frameincludes only one (1) frame, this one frame is selected. In step S1217,it is judged that the principal object area could not be determined, andthe current judgment process is finished.

FIG. 9 is the flow chart of the zone AF scan of step S809 in FIG. 5. Thezone means each range of plural ranges formed by dividing the focusabledistance range.

In step S1401, the focus lens 104 is moved to the scan start position.Here, the scan start position is, for example, the position at thetelephoto end. In step S1402, the A/D converting portion 109 convertsthe analog picture image signal read from the image-pickup element 108into the digital signal, the image processing portion 110 extracts thehigh frequency component of the luminance signal from the digitalsignal, and the CPU 115 executes storage of the high frequency componentas the focus evaluation value. In step S1403, the CPU 115 obtains thepresent position of the focus lens 104, and executes storage of data ofthis position.

In step S1404, the CPU 115 judges the state (ON/OFF) of SW1 forperforming instructions for the image-taking preparation. When the stateis ON, the current process is finished, and the step proceeds to stepS212 in FIG. 2. When the state is OFF, the step proceeds to step S1405.In step S1405, the scene change judgment is executed. In step S1406, theCPU 115 checks whether or not the present position of the focus lens 104is coincident with the boundary position of the zone beforehand set.When both positions are coincident with each other, the step proceeds tostep S1407. If not, the step proceeds to step S1409. In step S1407, thezone renewal judgment is performed according to procedures describedbelow (see FIG. 10). Here, the zone renewal means to scan a new zonesubsequent to the scan of a zone adjoining the new zone.

In step S1408, whether or not the zone renewal is decided to beperformed is checked based on the judgment result in step S1407. Whenthe zone renewal is decided to be performed, the step proceeds to stepS1409. If not, the step proceeds to step S1411. In step S1409, the CPU115 checks whether or not the present position of the focus lens 104 iscoincident with the scan finish position. When both positions arecoincident with each other, the step proceeds to step S1411. If not, thestep proceeds to step S1410. In step S1410, the focus lens 104 is movedtoward the scan finish direction by a given amount, and then the stepreturns to step S1402. In step S1411, the above principal object areajudgment in FIG. 7 is performed.

FIG. 10 is the flow chart of the zone renewal judgment of step S1407 inFIG. 9. In the zone renewal judgment, whether or not the principalobject is likely to exist in a position forward in the scan direction isjudged. That is, whether or not the AF scan is to be continued isjudged. FIGS. 11A and 11B illustrate an example of the zone renewaljudgment in FIG. 10. In this example, the size of the AF frame is set toten (10) percent of the image plane, N=5 and M=3.

In step S1501, the above focus judgment in FIG. 3 is performed for everyAF frame set. For example, the focus judgment result as illustrated inFIG. 11A is assumed to be obtained in every AF frame. In step S1502,whether or not the scan is performed onward to the final zone ischecked. When the scan is performed until the final zone, the stepproceeds to step S1512. If not, the step proceeds to step S1503. In stepS1503, whether or not the o-judgment frame exists is checked. When theo-judgment frame exists, the step proceeds to step S1504. If not, thestep proceeds to step S1511.

In step S1504, whether or not the judgment of the central frame is theΔ-judgment is checked. When the judgment of the central frame is theΔ-judgment, the step proceeds to step S1511. If not, the step proceedsto step S1505. In step S1505, whether or not a lump of at least a givennumber of Δ-judgment frames exists in the central M*M frames is checked.When the lump exists, the step proceeds to step S1511. If not, the stepproceeds to step S1506. In the example of FIGS. 11A and 11B, this givennumber is set to two (2). In step S1506, whether or not a lump includingat least a given number of Δ-judgment frame or frames of the N*N framesso that at least one frame of the central M*M frames is involved existsis checked. When such a lump exists, the step proceeds to step S1511. Ifnot, the step proceeds to step S1507. In the example of FIGS. 11A and11B, this given number is set to four (4). In step S1507, whether or nota lump including at least a given number of o-judgment frame or framesin the central M*M frames exists is checked. When such a lump exists,the step proceeds to step S1512. If not, the step proceeds to stepS1508. In the example of FIGS. 11A and 11B, this given number is five(5).

In step S1508, whether or not the central frame is the x-judgment frameis checked. When the central frame is the x-judgment frame, the stepproceeds to step S1511. If not, the step proceeds to step S1509. In stepS1509, whether or not a lump including at least a given number ofΔ-judgment or x-judgment frame or frames in the central M*M framesexists is checked. When such a lump exists, the step proceeds to stepS1511. If not, the step proceeds to step S1510. In the example of FIGS.11A and 11B, this given number is set to two (2). In step S1510, whetheror not the lump including at least a given number of Δ-judgment orx-judgment frame or frames in the N*N frames exists so that at least oneframe in the central M*M frames is involved is checked. When such a lumpexists, the step proceeds to step S1511. If not, the step proceeds tostep S1512. In the example of FIGS. 11A and 11B, this given number isfour (4). In step S1511, it is judged that the zone renewal is to beperformed, and the current judgment process is finished. In step S1512,it is judged that the zone renewal is not to be performed, and thecurrent judgment process is finished.

For example, in the case of N=5 and M=3, the lump is an area illustratedin gray in FIG. 11B, and it is judged that the zone renewal is to beperformed.

FIG. 12 is the flow chart of the uniformity judgment of step S811 inFIG. 5. Here, “a state of a uniform image plane” is a state in which aluminance difference or contrast is absent in the image plane, so thatthe peak of the focus evaluation value cannot be accurately acquired dueto lack of the contrast even if the AF operation is conducted. In thestate of a uniform image plane, if the object area identifying AF scanof step S208 in FIG. 2 is repeated each time the image-taking scenebecomes stable, variation in the focus state of the image plane iswastefully repeated. This repetition is cumbersome. Therefore, in theuniformity judging operation flow, if the state of a uniform image planeis detected, the motion of the focus lens 104 is stopped until negativejudgment of the state of a uniform image plane is made.

In step S1701, the uniformity judgment is executed according toprocedures described below (see FIG. 13). In step S1702, whether or notthe image-taking scene is judged to be uniform based on the judgmentresult in step S1701 is checked. When the scene is judged to be uniform,the step proceeds to step S1703. If not, the current judging process isfinished. In step S1703, the AF processing portion 105 moves the focuslens 104 to a given position. Herein, the given position is, forexample, a pan-focus distance position that includes an infinitydistance position on the telephoto side of the depth of field.

In step S1704, the CPU 115 judges the state (ON/OFF) of SW1 forperforming instructions for the image-taking preparation. When the stateis ON, the current process is finished, and the step proceeds to stepS212 in FIG. 2. When the state is OFF, the step proceeds to step S1705.In step S1705, uniformity judgment described below is executed. In stepS1706, whether or not the image-taking scene is judged to be uniformbased on the judgment result in step S1705 is checked. When the scene isjudged to be uniform, the step returns to step S1704. If not, thecurrent judging process is finished, and the step returns to step S201in FIG. 2.

As described above, it is possible to stop the focus lens 104 untilnegative judgment of the state of a uniform image plane is made.

FIG. 13 is the flow chart of the uniformity judgment of steps S1701 andS1705 in FIG. 12. Here, the state of a uniform image plane is judgedbased on luminance information and focus evaluation value of the imageplane. FIGS. 14A and 14B illustrate the example of the uniformityjudgment in FIG. 13. In FIG. 14A, a portion of [1] shows the state of auniform image plane, and a portion of [2] shows the state of anon-uniform image plane.

In step S1801, whether or not the number of AF frames set is one (1) ischecked. When a single AF frame is set, the step proceeds to step S1805.If not, the step proceeds to step S1802. In step S1802, “differencesbetween luminance integration values of central M*M frames and fourcorner respective M*M frames in N*N frames of the entire image plane”are calculated. For example, in a case where the size of the AF frame isset to 10 percent of the image plane, N=5 and M=3, the luminanceintegration value of the central M*M frames is obtained by integratingluminance values of a portion A in gray in FIG. 14B when theimage-taking scene is set to the portion [1] in a landscape of FIG. 14A.The luminance integration values of the four corner respective M*Mframes in the N*N frames are obtained by integrating luminance values ofportions B, C, D and E in gray in FIG. 14B, respectively. Where theluminance integration values are represented by A, B, C, D and E,“differences between luminance integration values of central M*M framesand four corner respective M*M frames in N*N frames of the entire imageplane” are absolute values of A-B, A-C, A-D and A-E, respectively.

In step S1803, whether or not a luminance difference above a given valueexists in the “differences between luminance integration values ofcentral M*M frames and four corner respective M*M frames in N*N framesof the entire image plane” calculated in step S1802 is checked. Whensuch a luminance difference exists, the step proceeds to step S1807. Ifnot, the step proceeds to step S1804. In step S1804, a value obtained bycalculating focus evaluation values of respective AF frames in thecentral M*M frames is set as a new focus evaluation value. A manner ofthe calculation is summation, for example. These are luminancedifference values obtained based on differences in luminance valuesobtained from output signals of the focus detecting areas set, and theevaluation value of the focus evaluation value obtained from the outputsignals of the focus detecting areas set. In step S1805, whether or notthe focus evaluation value is above a given value is checked. When thefocus evaluation value is above a given value, the step proceeds to stepS1807. If not, the step proceeds to step S1806. In step S1806, theimage-taking scene is judged to be uniform, and the current judgingprocess is finished. In step S1807, the image-taking scene is judged tobe non-uniform, and the current judging process is finished.

Thus, the scene can be judged to be uniform when the scene is uniform asillustrated by the portion [1] in FIG. 14A. The scene can be judged tobe non-uniform when the scene is non-uniform as illustrated by theportion [2] in FIG. 14A.

Here, in a case of the electronic zoom state or the like in which pluralfocus detecting areas cannot be set at the time of the first AF scanoperation, the evaluation value is acquired in a single focus detectingarea to perform the judgment, after the first AF scan operation isperformed. And, while the focus lens is stopped based on the judgmentresult, plural focus detecting areas are set and the evaluation valuesare obtained in the plural focus detecting areas.

FIG. 15 is the flow chart of the focusing drive of step S813 in FIG. 5.In step S2001, whether or not the principal object area could beidentified is checked. When the principal object area could bedetermined, the step proceeds to step S2002. If not, the step proceedsto step S2003. In step S2002, the focus is driven to the wide-angle endposition in the selected AF frame, and the current process is finished.In step S2003, whether or not the o-judgment frame exists in the centralM*M frames is checked. When the o-judgment frame exists, the stepproceeds to step S2004. If not, the step proceeds to step S2005. In stepS2004, the focus is driven to the wide-angle end position in theo-judgment frame in the central M*M frames, and the current process isfinished. In step S2005, the focus lens is driven to a position (fixedpoint) beforehand stored, and the current process is finished. Here, thefixed point is, for example, a distance position with a high existingprobability of the object.

FIG. 16 is the flow chart of the continuous AF of step S209 in FIG. 2.In step S2101, the focusing degree judging flag is set to TRUE. In stepS2102, the focus evaluation value is obtained in every AF frame set.

In step S2103, whether or not the number of AF frames set is one (1) ischecked. When the AF frame is one, the step proceeds to step S2105. Ifnot, the step proceeds to step S2104. In step S2104, the evaluationvalue calculated by using the focus evaluation value of the AF frameselected as the principal object area is re-set as the focus evaluationvalue to be used in step S2105 onward. Thereby, even if the image-takingscene changes and the principal object area in the image plane changes,the focus evaluation value of the principal object area in the imageplane can be calculated.

In step S2105, the focusing degree is calculated based on the focusevaluation value. In this embodiment, based on the focus evaluationvalue, the focusing degree is classified into high, medium and lowdegrees. In step S2106, the CPU 115 judges the state (ON/OFF) of SW1 forperforming instructions for image-taking preparation. When the state isON, the current process is finished, and the step proceeds to step S213in FIG. 2. When the state is OFF, the step proceeds to step S2107. Instep S2107, scene change judgment is performed.

In step S2108, whether or not the peak detection flag is TRUE ischecked. When TRUE, the step proceeds to step S2125. When FALSE, thestep proceeds to step S2109. In step S2109, the present position of thefocus lens 104 is acquired. In step S2110, one (1) is added to theacquisition count for counting acquisitions of the focus evaluationvalue and the present position of the focus lens 104. This count isassumed to be beforehand set to zero (0) in an initializing operation.In step S2111, whether or not the value of the acquisition count is one(1) is checked. When this value is one, the step proceeds to step S2114.If not, the step proceeds to step S2112.

In step S2112, whether or not the present focus evaluation value islarger than the previous focus evaluation value is checked. When theformer is larger than the latter, the step proceeds to step S2113. Ifnot, the step proceeds to step S2120. In step S2113, one (1) is added tothe increment count. In step S2114, the present focus evaluation valueis set as the maximum of the focus evaluation value, and stored in anoperational memory (not shown) built in the CPU 115. In step S2115, thepresent position of the focus lens 104 is set as the positioncorresponding to the peak of the focus evaluation value, and stored inthe operational memory built in the CPU 115. In step S2116, the presentfocus evaluation value is set as the previous focus evaluation value,and stored in the operational memory built in the CPU 115. In stepS2117, whether or not the present position of the focus lens 104 is atthe end of the focus lens move range is checked. When the presentposition is at the end, the step proceeds to step S2118. If not, thestep proceeds to step S2119. In step S2118, the moving direction of thefocus lens 104 is reversed. In step S2119, the focus lens 104 is movedby a given amount.

In step S2120, whether or not “(maximum of focus evaluationvalue)−(present focus evaluation value)” is larger than a given value ischecked. When this difference is larger than a given value, the stepproceeds to step S2121. If not, the step proceeds to step S2116. Here,if this difference is larger than a given value, i.e, the present focusevaluation value is smaller than the maximum value by a given value, themaximum value is deemed as the value corresponding to the focus peakposition. In step S2121, whether or not the increment count is largerthan zero (0) is checked. When the increment count is larger than zero,the step proceeds to step S2122. If not, the step proceeds to stepS2116. In step S2122, the focus lens 104 is moved to the peak positioncorresponding to the maximum of the focus evaluation value stored instep S2115. In step S2123, the peak detection flag is set to TRUE. Instep S2124, the acquisition count is set to zero (0).

In step S2125, whether or not the present focus evaluation value changesfrom the maximum of the focus evaluation value by above a given ratio ischecked. When the present focus evaluation value changes by above agiven ratio, the step proceeds to step S2127. If not, the step proceedsto step S2126. In step S2126, the position of the focus lens 104 ismaintained unchanged. In step S2127, in order to seek again the positionof the focus lens at which the focus evaluation value becomes maximum,the peak detection flag is set to FALSE, and the maximum of the focusevaluation value and the peak position are reset. In step S2128, theincrement count is reset.

As described above, in the continuous AF operation, the focus lens isdriven so that the principal object is kept in the in-focus state.

FIG. 17 is the flow chart of the image-taking process of step S213 inFIG. 2. In step S2301, the AE processing portion 103 performs the AEprocess for final exposure. In step S2302, the AF operation for finalexposure is performed according to procedures described below (see FIG.18). In step S2303, the CPU 115 judges the state (ON/OFF) of theimage-taking switch SW2 (122). When the state is ON, the step proceedsto step S2305. When the state is OFF, the step proceeds to step S2304.In step S2304, the state (ON/OFF) of SW1 for performing instructions forimage-taking preparation is judged. When the state is ON, the stepproceeds to step S2303. When the state is OFF, the current process isfinished. In step S2305, the final exposure process is performed, andthe current process is finished. The final exposure process is performedas follows. Data accumulated in the image-pickup element 108 is readsubsequent to exposure of the image-pickup element 108. The A/Dconverting portion 109 converts the analog signal read from theimage-pickup element 108 into the digital signal. The image processingportion 110 executes various kinds of image processes to the digitalsignal output from the A/D converting portion 109. The thus-processedimage is compressed according to a format, such as JPEG, under thecontrol of the CPU 115. And, the compressed data is supplied to theimage recording portion 114 and recorded therein under the control ofthe CPU 115.

FIG. 18 is the flow chart of the AF operation for final exposure of stepS2302 in FIG. 17. In step S2401, the AF frame setting for final exposureis performed. In the AF frame setting for final exposure, a frame with agiven size can be set in the central area, or a plurality of N*N framescan be set. In step S2402, whether or not the principal object detectionflag is TRUE is checked. When the flag is TRUE, the step proceeds tostep S2403. If not, the step proceeds to step S2409. In step S2403,whether or not the focusing degree calculated in step S2105 in FIG. 16is high is checked. When the focusing degree is high, the step proceedsto step S2404. If not, the step proceeds to step S2405.

In step S2404, the scan range is set to the first range (1) about thepresent position of the focus lens 104. Here, it is judged that theprincipal object is approximately in the in-focus state due to thecontinuous AF operation, i.e, the position of the focus lens is close tothe in-focus position corresponding to the peak of the focus evaluationvalue, and a narrow scan range is set. In step S2405, whether or not thefocusing degree calculated in step S2105 is medium is checked. When thefocusing degree is medium, the step proceeds to step S2406. If not, thestep proceeds to step S2407. In step S2406, the scan range is set to thesecond range (2) about the present position of the focus lens 104. Here,it is judged that the focusing degree is not so high though the positionof the focus lens is near the in-focus position due to the continuous AFoperation, and the scan range is set to a narrow range wider than thefirst scan range. In step S2407, whether or not the present position ofthe focus lens 104 is in a macro zone is checked. When the presentposition is in the macro zone, the step proceeds to step S2408. If not,the step proceeds to step S2409. In step S2408, the scan range is set tothe beforehand-stored third range (3) in the macro zone. In step S2409,the scan range is set to the beforehand-stored fourth range (4) that isthe entire focus detectable range.

In step S2501, the focus lens 104 is moved to the scan start position.The scan start position is assumed to be the end position of the scanrange set in step S2404, S2406, S2408 or S2409. In step S2502, the A/Dconverting portion 109 converts the analog picture image signal readfrom the image-pickup element 108 into the digital signal, the imageprocessing portion 110 extracts the high frequency component of theluminance signal from the digital signal, and the CPU 115 executesstorage of the high frequency component as the focus evaluation value.In step S2503, the CPU 115 obtains the present position of the focuslens 104, and executes storage of data of this position. In step S2504,the CPU 115 checks whether or not the present position of the focus lens104 is coincident with the scan finish position. When both positions arecoincident, the step proceeds to step S2506. If not, the step proceedsto step S2505. In step S2505, the focus lens 104 is moved toward thescan finish direction by a given amount, and then the step returns tostep S2502. In step S2506, the peak position of the focus evaluationvalue is calculated from the focus evaluation value and its lensposition stored in step S2502. In calculation of the peak position ofthe focus evaluation value, where plural AF frames are set, thiscalculation can be performed based on the peak position on thewide-angle side of the principal object area determined by the principalobject area judgment in FIG. 7. Or, the calculation of the peak positioncan be performed by another judging method. And, in step S2411, thefocus lens 104 is moved to the peak position calculated in step S2506.

As described above, in this embodiment, it is possible to speedily focuson the principal object subsequent to instructions for image-takingpreparation operation since the principal object area is determinedprior to the instructions for image-taking preparation operation and theprincipal object area continues to be focused. Further, in a case wherethe principal object area cannot be determined prior to the instructionsfor image-taking preparation operation, the uniformity judgment isperformed, and the focus lens 104 is stopped at a given position untilnegative judgment of the state of a uniform image plane is made.Therefore, wasteful variation in the focus state prior to theimage-taking preparation operation can be prevented, and the image lookin the state of a uniform image plane can be improved.

FIG. 19 is the flow chart of the uniformity judging operation in thesecond embodiment of step S811 in FIG. 5. In step S2701, the uniformityjudgment is executed according to procedures described above. In stepS2702, whether or not the image-taking scene is judged to be uniformbased on the judgment result in step S2701 is checked. When the scene isjudged to be uniform, the step proceeds to step S2703. If not, thecurrent judging process is finished.

In step S2703, judgment of a stop position of the focus lens isperformed. Here, the image-taking scene is predicted, and the lens stopposition is judged based on the prediction result. For example, colorinformation in the image plane is acquired by the image processingportion 110, and the lens stop position is judged to be the telephotoend position when the scene can be predicted to be a distant view suchas blue sky and evening landscape. Where the scene cannot be predictedto be the distant view, the lens stop position can be judged to be theposition at which the focus evaluation value obtained by the zone AFscan of step S809 is maximum. In a case where the lens stop positioncannot be determined by any method, the lens stop position is judged tobe a position (fixed point) at which the presence probability of theprincipal object is high, and the step proceeds to step S2704. Thus, inthis embodiment, color information in the area is obtained, and theimage-taking scene is predicted based on the color information obtained.And, the focus lens stop position is determined based on the predictedscene.

In step S2704, the AF processing portion 105 moves the focus lens 104 tothe position determined in step S2703. In step S2705, the CPU 115 judgesthe state (ON/OFF) of SW1 for performing instructions for theimage-taking preparation. When the state is ON, the current process isfinished, and the step proceeds to step S212 in FIG. 2. When the stateis OFF, the step proceeds to step S2706. In step S2706, the uniformityjudgment described above is executed. In step S2707, whether or not theimage-taking scene is judged to be uniform based on the judgment resultin step S2706 is checked. When the scene is judged to be uniform, thestep returns to step S2705. If not, the current judging process isfinished, and the step returns to step S201 in FIG. 2.

As described above, in the second embodiment, when the focus lens 104 isstopped at a given position until negative judgment of the state of auniform image plane is made, the lens stop position is judged based onthe prediction result of the image-taking scene. Therefore, the imagelook during the lens stop condition in the state of a uniform imageplane can be improved.

FIG. 20 is the flow chart of the uniformity judging operation in thethird embodiment of step S811 in FIG. 5. In step S2801, the uniformityjudgment is executed according to procedures described above. In stepS2802, whether or not the image-taking scene is judged to be uniformbased on the judgment result in step S2801 is checked. When the scene isjudged to be uniform, the step proceeds to step S2803. If not, thecurrent judging process is finished.

In step S2803, whether or not a frame expanding flag is TRUE is checked.When TRUE, the step proceeds to step S2804. When FALSE, the stepproceeds to step S2807. Here, when the frame expanding flag is TRUE, theAF frame in the zone AF scan of step S809 is set to an area with a sizelarger than that of a given area beforehand set. When the frameexpanding flag is FALSE, the AF frame in the zone AF scan of step S809is set to a given area beforehand set. In step S2804, the AF frame inthe zone AF scan of step S809 is re-set to the area with a size largerthan a given size beforehand set, and the step proceeds to step S2805.

FIGS. 21A to 21C illustrate the set area of the AF frame in the zone AFscan of step S809. FIG. 21A illustrates the entire area. In FIG. 21B, noobject exists in the AF frame, and the state has a uniform image plane.In FIG. 21C, the set area of the AF frame is re-set to the area with astill larger size, and an object in the periphery of the image planecomes into the AF frame.

In step S2805, the frame expanding flag is set to TRUE, and the stepproceeds to step S2806. In step S2806, the CPU 115 judges the state(ON/OFF) of SW1 for performing instructions for image-takingpreparation. When the state is ON, the current process is finished, andthe step proceeds to step S212. When the state is OFF, the stateproceeds to step S809.

In step S2807, the frame expanding flag is set to FALSE, and the stepproceeds to step S2808. In step S2808, the AF processing portion 105moves the focus lens 104 to a given position. The given position is thepan-focus distance position, for example. In step S2809, CPU 115 judgesthe state (ON/OFF) of SW1 for performing instructions for image-takingpreparation. When the state is ON, the current process is finished, andthe step proceeds to step S212. When the state is OFF, the stateproceeds to step S2810. In step S2810, the uniformity judgment describedabove is performed. In step S2811, whether or not the image-taking sceneis judged to be uniform based on the judgment result in step S2810 ischecked. When the scene is judged to be uniform, the step returns tostep S2809. If not, the current judging process is finished, and thestep returns to step S201.

FIG. 22 is the flow chart of the zone renewal judgment of step S1407 inFIG. 9. In the zone renewal judgment, whether or not the principalobject is likely to exist in a position forward in the scan direction isjudged. That is, whether or not the AF scan is to be continued isjudged.

FIGS. 11A and 11B illustrate the example of the zone renewal judgment inFIG. 22. In this example, the size of the AF frame is set to ten (10)percent of the image plane, N=5 and M=3.

In step S3001, the above focus judgment is performed for every AF frameset. For example, the focus judgment result as illustrated in FIG. 11Ais assumed to be obtained in every AF frame. In step S3002, whether ornot the scan is performed onward to the final zone is checked. When thescan is performed up to the final zone, the step proceeds to step S3015.If not, the step proceeds to step S3003. In step S3003, whether or notthe o-judgment frame exists is checked. When the o-judgment frameexists, the step proceeds to step S3004. If not, the step proceeds tostep S3014. In step S3004, whether or not the frame expanding flag isTRUE is checked. When TRUE, the step proceeds to step S3012. When FALSE,the step proceeds to step S3005. Here, the process of the zone renewaljudgment is changed depending on the frame expanding flag. The reasontherefor is that a predicted area with a high presence probability ofthe principal object in the image plane varies depending on TRUE/FALSEof the frame expanding flag. When the frame expanding flag is FALSE, thepresence probability of the principal object is assumed to be high in anarea near the central portion of the image plane. When the frameexpanding flag is TRUE, the presence probability of the principal objectis assumed to be high in a peripheral area of the image plane.

In step S3005, whether or not the judgment of the central frame is theΔ-judgment is checked. When the judgment of the central frame is theΔ-judgment, the step proceeds to step S3014. If not, the step proceedsto step S3006. In step S3006, whether or not a lump of at least a givennumber of Δ-judgment frames exists in the central M*M frames is checked.When the lump exists, the step proceeds to step S3014. If not, the stepproceeds to step S3007. In the example of FIGS. 11A and 11B, this givennumber is set to two (2), for example. In step S3007, whether or not alump of at least a given number of Δ-judgment frame or frames of the N*Nframes including at least one frame of the central M*M frames exists ischecked. When such a lump exists, the step proceeds to step S3014. Ifnot, the step proceeds to step S3008. In the example of FIGS. 11A and11B, this given number is set to four (4), for example. In step S3008,whether or not a lump including at least a given number of o-judgmentframe or frames in the central M*M frames exists is checked. When such alump exists, the step proceeds to step S3015. If not, the step proceedsto step S3009. In the example of FIGS. 11A and 11B, this given number isfive (5), for example.

In step S3009, whether or not the central frame is the x-judgment frameis checked. When the central frame is the x-judgment frame, the stepproceeds to step S3014. If not, the step proceeds to step S3010. In stepS3010, whether or not a lump including at least a given number ofΔ-judgment or x-judgment frame or frames in the central M*M framesexists is checked. When such a lump exists, the step proceeds to stepS3014. If not, the step proceeds to step S3011. In the example of FIGS.11A and 11B, this given number is set to two (2). In step S3011, whetheror not a lump of at least a given number of Δ-judgment or x-judgmentframe or frames of the N*N frames including at least one frame in thecentral M*M frames exists is checked. When such a lump exists, the stepproceeds to step S3014. If not, the step proceeds to step S3015. In theexample of FIGS. 11A and 11B, this given number is four (4), forexample.

In step S3012, whether or not a lump of at least a given number ofΔ-judgment frames exists in the N*N frames is checked. When the lumpexists, the step proceeds to step S3014. If not, the step proceeds tostep S3013. In step S3013, whether or not a lump of at least a givennumber of o-judgment frame or frames exists in the N*N frames ischecked. When the lump exists, the step proceeds to step S3015. If not,the step proceeds to step S3014. In step S3014, it is judged that thezone renewal is to be performed, and the current judgment process isfinished. In step S3015, it is judged that the zone renewal is not to beperformed, and the current judgment process is finished. For example, inthe case of N=5 and M=3, the lump is an area illustrated in gray in FIG.11B, and it is judged that the zone renewal is to be performed.

FIG. 23 is the flow chart of the principal object area judgment of stepS1307 in FIG. 8 and step S1411 in FIG. 9. In the principal object areajudgment, whether or not the principal object area in the image planecould be determined is judged. Similarly to the zone renewal judgment,the process of the principal object area judgment is changed dependingon the state of the frame expanding flag since the predicted area with ahigh presence probability of the principal object in the image planevaries depending on TRUE/FALSE of the frame expanding flag.

FIGS. 8A to 8C illustrate the example of the principal object areajudgment in FIG. 23. In this example, the size of the AF frame is set to10 percent of the image plane, N=5, M=3, the scan range is set to arange from zero (0) to 500, and a given depth range is set to ±10.

In step S3101, the above-described focus judgment is performed for everyAF frame set. For example, in every AF frame, the focus judgment resultis assumed to be one illustrated in FIG. 8A. In step S3102, the peakposition (PeakPos) of the focus evaluation value in each AF frame iscalculated and stored. For example, in every AF frame, the peak positioncalculation result is assumed to be one illustrated in FIG. 8B. In stepS3103, whether or not the number of AF frames set is one (1) is checked.When a single AF frame is set, the step proceeds to step S3120. If not,the step proceeds to step S3104.

In step S3104, whether or not the frame expanding flag is TRUE ischecked. When FALSE, the step proceeds to step S3105. When TRUE, thestep proceeds to step S3106. In step S3105, PeakPos's of AF frames inthe central M*M frames are sorted from the wide-angle end. The number ofsort is represented by S. Here, the peak position of the AF frame withthe x-judgment judged in the focus judgment of step S3101 cannot becalculated, so that such an AF frame is excluded from AF frames to besorted. For example, in the case of FIG. 8B, the sort result from thewide-angle end is indicated as 410, 400, 400, 400, 100, 100, 100 and 90,and the sort number S is S=8. In step S3106, PeakPos's of AF frames inthe N*N frames are sorted from the wide-angle end, and the number ofsort is set to S.

In step S3107, the count P for showing the order from the wide-angle endof peak positions calculated in step S3102 is set to one (1). In stepS3108, the P-th PeakPos in the sort order is set to PeakPosP. Forexample, in the case of FIG. 8B, when P=1, PeakPosP=410. In step S3109,whether or not the frame expanding flag is TRUE is checked. When FALSE,the step proceeds to step S3110. When TRUE, the step proceeds to stepS3115.

In step S3110, in the central M*M AF frames, a lump of AF frames withthe o-judgment and within a given depth range from the frame of PeakPosPis detected, and the number and positions of AF frames constituting thelump are stored. Here, in the lump, AF frames satisfying the aboveconditions are adjoining each other in horizontal and verticaldirections, for example. In a case where there are plural lumps, one ofthem can be selected considering numbers of AF frames and positions ofthe respective lumps.

In step S3111, in the central N*N AF frames, a lump of AF frames withthe o-judgment and within a given depth range from the frame of PeakPosPis detected, and the number and positions of AF frames constituting thislump are stored. For example, in the case of judgment results asillustrated in FIGS. 8A and 8B, the lump including frames illustrated ingray in FIG. 8C is detected. In step S3112, whether or not the lumpdetected in step S3110 or S3111 includes a central frame is checked.When the lump includes the central frame, the step proceeds to stepS3121. If not, the step proceeds to step S3113.

In step S3113, whether or not the lump detected in step S3110 or S3111includes at least a given number of frames in the M*M frames is checked.When the lump includes such frame or frames, the step proceeds to stepS3121. If not, the step proceeds to step S3114. In step S3114, whetheror not the lump detected in step S3110 or S3111 includes at least oneframe of the central M*M frames and at least a given number of frame orframes of the N*N frames is checked. When the lump includes such frames,the step proceeds to step S3121. If not, the step proceeds to stepS3117.

In step S3115, in the central N*N AF frames, a lump of AF frames withthe o-judgment and within a given depth range from the frame of PeakPosPis detected, and the number and positions of AF frames constituting thelump are stored. In step S3116, whether or not the lump detected in stepS3115 is a lump including at least a given number of frames in the N*NAF frames is checked. When the lump includes such frames, the stepproceeds to step S3121. If not, the step proceeds to step S3117.

In step S3117, one (1) is added to the count P. In step S3118, whetheror not the count P is larger than the sort number S is checked. When thecount P is larger than the sort number S, the step proceeds to stepS3119. If not, the step returns to step S3108.

In step S3120, whether or not the result is the o-judgment is checked.When the result is the o-judgment, the step proceeds to step S3121. Ifnot, the step proceeds to step S3119. In step S3121, positive judgmentof determination of the principal object area is made. In step S3122, AFframe or frames constituting the lump is judged to be the principalobject area and selected, and the current judgment process is finished.In a case where the thus-set AF frame includes only one (I) frame, thisone frame is selected. In step S3119, it is judged that the principalobject area could not be determined, and the current judgment process isfinished.

FIG. 24 is the flow chart of the AF operation for final exposure of stepS2302 in FIG. 17. In step S3201, whether or not the frame expanding flagis TRUE is checked. When the flag is FALSE, the step proceeds to stepS3202. When the flag is TRUE, the step proceeds to step S3203. In stepS3202, the AF frame setting for final exposure is performed to an areahaving a given size set beforehand. In step S3203, the AF operation forfinal exposure is performed to an area having a size larger than thegiven size set beforehand.

Here, determination of the object to be focused in the focus detectingarea with the first size is performed in the above first AF scan underthe control of the CPU 115. And, when the evaluation value is largerthan the first threshold but does not exceed the second threshold, thefirst AF scan operation is again performed in the focus detecting areawith the second size larger than the focus detecting area with the firstsize. In this embodiment, when the first AF scan operation is againperformed in the second focus detecting area, the focusing operation isexecuted in the focus detecting area with the size larger than the sizeof the focus detecting area beforehand set, in the second AF scanoperation for final exposure.

In step S3204, whether or not the principal object detection flag isTRUE is checked. When the flag is TRUE, the step proceeds to step S3205.If not, the step proceeds to step S3211. In step S3205, whether or notthe focusing degree calculated in step S2107 is high is checked. Whenthe focusing degree is high, the step proceeds to step S3206. If not,the step proceeds to step S3207.

In step S3206, the scan range is set to the first range (1) about thepresent position of the focus lens 104. Here, it is judged that theprincipal object is approximately in the in-focus state due to thecontinuous AF operation, i.e, the position of the focus lens is close tothe in-focus position corresponding to the peak of the focus evaluationvalue, and a narrow scan range is set. In step S3207, whether or not thefocusing degree calculated in step S2105 is medium is checked. When thefocusing degree is medium, the step proceeds to step S3206. If not, thestep proceeds to step S3209. In step S3208, the scan range is set to thesecond range (2) about the present position of the focus lens 104. Here,it is judged that the focusing degree is not so high though the positionof the focus lens is near the in-focus position due to the continuous AFoperation, and the scan range is set to a narrow range wider than thefirst scan range (1). In step S3209, whether or not the present positionof the focus lens 104 is in the macro zone is checked. When the presentposition is in the macro zone, the step proceeds to step S3210. If not,the step proceeds to step S3211. In step S3210, the scan range is set tothe beforehand-stored third range (3) in the macro zone. In step S3211,the scan range is set to the beforehand-stored fourth range (4) that isthe entire focus detectable range. In step S3212, the AF scan for finalexposure is performed. In step S3213, the focus lens 104 is moved to thepeak position calculated in step S2506.

As described above, in the third embodiment, when it is judged that theimage plane is uniform, the size of the set area for the AF frame isre-set to the size larger than a given size set beforehand, and the zoneAF scan of step S809 is again performed. Therefore, even when theprincipal object exists outside the set area for the AF frame of thezone AF scan of step S809, it is possible to focus on the principalobject area.

Except as otherwise discussed herein, the various components shown inoutline or in block form in the Figures are individually well known andtheir internal construction and operation are not critical either to themaking or using, or to a description of the best mode of the invention.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2009-034114, filed Feb. 17, 2009, which is hereby incorporated byreference herein in its entirety.

1. An apparatus comprising: a receiving unit configured to receive aninstruction for focus adjustment; an image-pickup unit configured toperform image-pickup of an image input through a focus lens to supplyimage data; a setting unit configured to set a focus detecting area; anda focus adjusting unit configured to detect a focus signal representinga focusing state of the focus lens in the focus detecting area whilemoving the focus lens to adjust a position of the focus lens in apredetermined range based on the focus signal, wherein the focusadjusting unit controls a first operation for detecting the focussignal, prior to reception of the instruction, to determine an objectarea to be focused, and a second operation for detecting the focussignal based on information of the determined object area, uponreception of the instruction, to perform the focus adjustment of thefocus lens, and stops the focus lens at a position in the firstoperation on at least one of an evaluation value relevant to luminancein a predetermined area of the image data and a focus signal, theevaluation value and the focus signal being such that the focusadjusting unit cannot determine the object area to be focused.
 2. Theapparatus according to claim 1, wherein the focus adjusting unit stopsthe focus lens at the position when at least one of a condition that theevaluation value does not exceed a predetermined value and a conditionthat the focus signal does not exceed a predetermined value issatisfied.
 3. The apparatus according to claim 1, wherein the evaluationvalue is a luminance difference value obtained based on a differencebetween luminance values in plural focus detecting areas of the imagedata, and the focus signal is based on a predetermined-frequencycomponent of an output signal of the image-pickup unit in the focusdetecting area of the image data.
 4. The apparatus according to claim 1,wherein the focus adjusting unit determines an object to be focused inthe focus detecting area with a first size in the first operation, andthe focus adjusting unit again performs the first operation in the focusdetecting area with a second size larger than the focus detecting areawith the first size when at least one of a condition that the evaluationvalue does not exceed the predetermined value and a condition that thefocus signal does not exceed the predetermined value is satisfied. 5.The apparatus according to claim 4, wherein the focus adjusting unitperforms the focus adjusting operation in the focus detecting area witha size larger than the focus detecting area with a size set beforehandin the second operation when the first operation is again performed inthe focus detecting area with the second size.
 6. The apparatusaccording to claim 1, wherein the focus adjusting unit determines a stopposition of the focus lens based on color information in the focusdetecting area.
 7. The apparatus according to claim 1, wherein when aplurality of focus detecting areas are not set at a time of the firstoperation, the focus adjusting unit acquires the focus signal in thefocus detecting area, and performs judgment whether or not at least oneof a condition that the evaluation value does not exceed thepredetermined value and a condition that the focus signal does notexceed the predetermined value is satisfied, and when at least one ofthe conditions is satisfied and the focus lens stops, the focusadjusting unit acquires focus signals in a plurality of focus detectingareas set.
 8. A method of controlling an apparatus including animage-pickup unit for performing image-pickup of an image input througha focus lens to supply image data, the method comprising: setting afocus detecting area; and detecting a focus signal in the focusdetecting area while moving the focus lens to adjust a position of thefocus lens based on the focus signal, wherein in the detecting, a firstoperation for detecting the focus signal, prior to reception of aninstruction, to determine an object area to be focused, and a secondoperation for detecting the focus signal based on information of thedetermined object area to be focused, upon reception of the instruction,to perform the focus adjustment of the focus lens are controlled, andthe focus lens is stopped at a position in the first operation on atleast one of an evaluation value relevant to luminance in apredetermined area of the image data and a focus signal, the evaluationvalue and the focus signal being such that the object area to be focusedcannot be determined in the detecting.
 9. The method according to claim8, further comprising stopping the focus lens at the position when atleast one of a condition that the evaluation value does not exceed apredetermined value and a condition that the focus signal does notexceed the predetermined value is satisfied.
 10. The method according toclaim 8, wherein the evaluation value is a luminance difference valueobtained based on a difference between luminance values in plural focusdetecting areas of the image data, and the focus signal in the focusdetecting area of the image data.
 11. The method according to claim 8,further comprising: determining an object to be focused in the focusdetecting area with a first size in the first operation; and performingthe first operation in the focus detecting area with a second sizelarger than the focus detecting area with the first size when at leastone of a condition that the evaluation value does not exceed thepredetermined value and a condition that the focus signal does notexceed the predetermined value is satisfied.
 12. The method according toclaim 11, further comprising performing the focus adjusting operation inthe focus detecting area with a size larger than the focus detectingarea with a size set beforehand in the second operation when the firstoperation is again performed in the focus detecting area with the secondsize.
 13. The method according to claim 8, further comprisingdetermining a stop position of the focus lens based on color informationin the focus detecting area.
 14. The method according to claim 8,further comprising: acquiring the focus signal in the focus detectingarea when a plurality of focus detecting areas are not set at a time ofthe first operation, the focus adjusting unit; performing judgmentwhether or not at least one of a condition that the evaluation valuedoes not exceed the predetermined value and a condition that the focussignal does not exceed the predetermined value is satisfied; andacquiring focus signals in a plurality of focus detecting areas set whenat least one of the conditions is satisfied and the focus lens stops.